package com.goodsogood.union.auth.web.validator;

import com.dongguochao.validation.Validator;
import com.dongguochao.validation.constraints.impl.LengthValidator;
import com.dongguochao.validation.constraints.impl.NotBlankValidator;

/**
 * Created by dongguochao on 17/11/2016.
 */
public class UserAddValidator extends Validator {
    @Override
    public void setup() {
        add(new NotBlankValidator("userIdCard", "1", "身份证号不能为空"));
        add(new NotBlankValidator("companyId", "1", "请指定公司id"));

        add(new LengthValidator("userName", 16, "1", "用户姓名过长"));
        add(new LengthValidator("userPhone", 11, "1", "电话号码格式错误，最大11位"));
        add(new LengthValidator("userIdCard", 18, "1", "身份证格式错误"));
//        add(new PatternValidator("userIdCard", "(^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)", "1", "请输入15或18位正确的身份证号"));

        add(new LengthValidator("userNativePlace", 25, "1", "籍贯过长"));
        add(new LengthValidator("userMinority", 25, "1", "民族，过长"));
        add(new LengthValidator("userEducation", 25, "1", "学历，过长"));
        add(new LengthValidator("userNation", 25, "1", "国籍，过长"));
        add(new LengthValidator("userResidenceType", 25, "1", "户口类型，过长"));
        add(new LengthValidator("userResidenceProvince", 25, "1", "户口所在省份，过长"));
        add(new LengthValidator("userResidenceCity", 25, "1", "户口所在市，过长"));
        add(new LengthValidator("userResidenceDistinct", 25, "1", "户口所在区，过长"));
        add(new LengthValidator("userResidenceAddress", 25, "1", "户口地址，过长"));
        add(new LengthValidator("userDocumentLocation", 25, "1", "档案所在地，过长"));
        add(new LengthValidator("userWorkStatus", 10, "1", "工作状态，过长"));
        add(new LengthValidator("userMarryStatus", 10, "1", "婚姻状态，过长"));
        add(new LengthValidator("userOrgnization", 25, "1", "组织，过长"));
        add(new LengthValidator("userReligion", 25, "1", "宗教，过长"));
        add(new LengthValidator("userQQ", 25, "1", "qq，过长"));
        add(new LengthValidator("companyDept", 25, "1", "所在部门，过长"));
        add(new LengthValidator("userHomeProvince", 25, "1", "家庭住址省份，过长"));
        add(new LengthValidator("userHomeCity", 25, "1", "家庭住址市，过长"));
        add(new LengthValidator("userHomeDistinct", 25, "1", "家庭住址区，过长"));
        add(new LengthValidator("userHomeStreet", 25, "1", "家庭住址街道，过长"));
        add(new LengthValidator("userHomeAddress", 25, "1", "家庭住址地址，过长"));
        add(new LengthValidator("userContact", 10, "1", "常用通信联系人，过长"));
        add(new LengthValidator("userContactPhone", 11, "1", "常用通信联系人电话，过长"));
        add(new LengthValidator("userContactProvince", 25, "1", "常用通信联系人省份，过长"));
        add(new LengthValidator("userContactCity", 25, "1", "常用通信联系人市，过长"));
        add(new LengthValidator("userContactDistinct", 25, "1", "常用通信联系人区，过长"));
        add(new LengthValidator("userContactAddress", 25, "1", "常用通信联系人地址，过长"));
        add(new LengthValidator("userHealthy", 25, "1", "健康状态，过长"));
        add(new LengthValidator("userDisableLevel", 25, "1", "残疾等级，过长"));
        add(new LengthValidator("userMedicalStatus", 25, "1", "医保状态，过长"));
        add(new LengthValidator("userIsSelfRescue", 25, "1", "是否有一定自救能力，过长"));
        add(new LengthValidator("userIsModelWorker", 25, "1", "劳模，过长"));
        add(new LengthValidator("companyEnterTime", 25, "1", "加入企业／签订合同时间，过长"));
        add(new LengthValidator("companyDept", 25, "1", "所在部门，过长"));
        add(new LengthValidator("companyPhone", 25, "1", "工作联系电话，过长"));
        add(new LengthValidator("companyIsInsurance", 25, "1", "是否缴纳社保，过长"));
        add(new LengthValidator("companyPosition", 25, "1", "职务，过长"));
        add(new LengthValidator("companyIsRent", 25, "1", "是否外派，过长"));
        add(new LengthValidator("companyIsFarmer", 25, "1", "是否农名工，过长"));
        add(new LengthValidator("companyIsSign", 25, "1", "是否签订劳动合同，过长"));
        add(new LengthValidator("companyLevel", 25, "1", "行政等级，过长"));
        add(new LengthValidator("companyLevelPosition", 25, "1", "行政职务，过长"));
        add(new LengthValidator("companySalary", 25, "1", "薪资，过长"));
        add(new LengthValidator("companyInsuranceStarttime", 25, "1", "社保起买时间，过长"));
        add(new LengthValidator("companyInsuranceMoney", 25, "1", "每月缴纳社保金额，过长"));
        add(new LengthValidator("companyFundStarttime", 25, "1", "公积金起买时间，过长"));
        add(new LengthValidator("companyFundMoney", 25, "1", "每月缴纳公积金金额，过长"));
        add(new LengthValidator("companySalaryChannel", 25, "1", "发薪方式，过长"));
        add(new LengthValidator("familyPoorType", 25, "1", "家庭贫困登记，过长"));
        add(new LengthValidator("familyHouseRoom", 25, "1", "家庭住房面积，过长"));
        add(new LengthValidator("familyHouseType", 25, "1", "家庭房屋类型，过长"));
        add(new LengthValidator("familyIsSingle", 25, "1", "子女是否单亲，过长"));
        add(new LengthValidator("familyPersonCount", 25, "1", "家庭人口数，过长"));
        add(new LengthValidator("familyMonthIncome", 25, "1", "家庭月收入，过长"));
        add(new LengthValidator("familyYearExtraIncome", 25, "1", "年其他收入，过长"));
        add(new LengthValidator("familyYearIncome", 25, "1", "年总收入，过长"));
        add(new LengthValidator("familyIsNoneWork", 25, "1", "是否令工作家庭，过长"));
        add(new LengthValidator("familyPoorMainReason", 25, "1", "主要致贫原因，过长"));
        add(new LengthValidator("familyPoorSecondReason", 25, "1", "次要致贫原因，过长"));
        add(new LengthValidator("creator", 32, "1", "建档人，过长"));
        add(new LengthValidator("checker", 32, "1", "审核人，过长"));
        add(new LengthValidator("groupEnterTime", 25, "1", "工会加入时间，过长"));

    }
}
